package factory.method;

public abstract class Factory {
    public Product create() {
        // 创建产品
        Product product = createProduct();
        // 注册产品
        register(product);
        return product;
    }

    protected abstract Product createProduct();

    protected abstract void register(Product product);
}
